package org.gdstash.ui.table;

import org.gdstash.item.GDItem;
import org.gdstash.util.GDMsgFormatter;

import javax.swing.*;

public class GDItemCollectionRow {
    public static final Class[] COLUMN_CLASSES;
    public static String[] columnNames;
    public GDItemInfo item;
    public String baseName;
    public boolean softcore;
    public boolean hardcore;
    public ImageIcon icon;
    public GDItem.LabelInfo name;
    public GDItem.LabelInfo level;
    public ImageIcon scIcon;
    public ImageIcon hcIcon;

    public static void updateColumnNames() {
        if (GDItemCollectionRow.columnNames == null) {
            GDItemCollectionRow.columnNames = new String[5];
        }
        GDItemCollectionRow.columnNames[0] = GDMsgFormatter.getString(GDMsgFormatter.rbUI, "TXT_PICTURE");
        GDItemCollectionRow.columnNames[1] = GDMsgFormatter.getString(GDMsgFormatter.rbUI, "TXT_ITEM_NAME");
        GDItemCollectionRow.columnNames[2] = GDMsgFormatter.getString(GDMsgFormatter.rbUI, "TXT_LEVEL");
        GDItemCollectionRow.columnNames[3] = GDMsgFormatter.getString(GDMsgFormatter.rbUI, "TXT_SOFTCORE");
        GDItemCollectionRow.columnNames[4] = GDMsgFormatter.getString(GDMsgFormatter.rbUI, "TXT_HARDCORE");
    }

    static {
        COLUMN_CLASSES = new Class[]{Icon.class, String.class, String.class, Icon.class, Icon.class};
        GDItemCollectionRow.columnNames = null;
        updateColumnNames();
    }
}
